I got this following error while running the command " python manage.py migrate"
"Migration admin.0001_initial is applied before its dependency admin.0001_initial on database default"
SOLUTION:
STEP 1:
Go to admin project's URL.py and comment the line "admin.site.urls" in urlpatterns.
from django.contrib import admin from django.urls import include, path, re_path as url urlpatterns = [ #path('admin/', admin.site.urls), path('', include(('myaccount.urls', 'myaccount'), namespace='myaccount')), url(r'cricket/', include(('cricket.urls', 'cricket'), namespace='cricket')), ]
STEP 2:
And then go to settings.py and comment the "django.contrib.admin" in INSTALLED_APPS.
INSTALLED_APPS = [ #'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'myaccount', ]
Now run the command python manage.py migrate. It will run the migration successful.
Finally un comment it.
VIDEO GUIDE:
Post your comments / questions
Recent Article
- How to create custom 404 error page in Django?
- Requested setting INSTALLED_APPS, but settings are not configured. You must either define..
- ValueError:All arrays must be of the same length - Python
- Check hostname requires server hostname - SOLVED
- How to restrict access to the page Access only for logged user in Django
- Add or change a related_name argument to the definition for 'auth.User.groups' or 'DriverUser.groups'. -Django ERROR
- Addition of two numbers in django python
- The request was aborted: Could not create SSL/TLS secure channel -Error in Asp.net
Related Article